﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace _04.QueueBFS
{
    class QueueBFS
    {
        static void Main(string[] args)
        {
            List<int>[] nodes = new List<int>[7];
            nodes[0] = new int[] { 3, 6 }.ToList();
            nodes[1] = new int[] { 2, 3, 4, 5, 6 }.ToList();
            nodes[2] = new int[] { 1, 4, 5 }.ToList();
            nodes[3] = new int[] { 0, 1, 5 }.ToList();
            nodes[4] = new int[] { 1, 2, 6 }.ToList();
            nodes[5] = new int[] { 1, 2, 3 }.ToList();
            nodes[6] = new int[] { 0, 1, 4 }.ToList();

            Graph graph = new Graph(nodes);
            Console.WriteLine("Queue-based BFS traversal:");
            graph.QueueBFS(0);
        }
    }
}
